package com.itlong.cloud.equip.operate;

import com.itlong.cloud.POJO.DTO.operate.OperateDeviceQRCodePageDTO;
import com.itlong.cloud.POJO.VO.operate.OperateDeviceQRCodeInfoAllVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * <desc>
 *      设备二维码管理接口暴露
 * </desc>
 *
 * @createDate 2020/2/24
 */
@FeignClient(name = "equip-service")
public interface IOperateDeviceQRCodeServiceClient {

    /**
     * <desc>
     *      获取设备二维码分页数据
     * </desc>
     *
     * @param operateDeviceQRCodePageDTO 查询参数DTO
     * @return
     * @Author Zhu.yj
     * @createDate  2020/2/24
     */
    @PostMapping("/device/qrCode/getDeviceQRCodeByPage")
    OperateDeviceQRCodeInfoAllVO getDeviceQRCodeByPage(@RequestBody OperateDeviceQRCodePageDTO operateDeviceQRCodePageDTO) throws Exception;

    /**
     * <desc>
     *      批量创建设备二维码
     * </desc>
     *
     * @param operateDeviceQRCodePageDTO 参数DTO
     * @return
     * @Author Zhu.yj
     * @createDate  2020/2/25
     */
    @PostMapping("/device/qrCode/batchSave")
    Integer batchSave(@RequestBody OperateDeviceQRCodePageDTO operateDeviceQRCodePageDTO) throws Exception;

    /**
     * <desc>
     *      批量更改设备二维码状态
     * </desc>
     *
     * @param operateDeviceQRCodePageDTO 更新参数DTO
     * @return 受影响行数
     * @Author Zhu.yj
     * @createDate  2020/2/25
     */
    @PostMapping("/device/qrCode/updateStatus")
    Integer updateStatus(@RequestBody OperateDeviceQRCodePageDTO operateDeviceQRCodePageDTO) throws Exception;

    /**
     * <desc>
     *      根据code获取useStatus与status
     * </desc>
     *
     * @param codes 二维码id
     * @return
     * @Author Zhu.yj
     * @createDate  2020/3/2
     */
    @PostMapping("/device/qrCode/getQRCodeStatus")
    List<Map<String, Object>> getQRCodeStatus(@RequestParam("codes") String codes) throws Exception;
}
